#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int main()
{
	int m, n;
	printf("Enter m,n;");
	scanf("%d%d", &m, &n);
	while (m != n) //1
	{
		while (m > n) m = m - n; //2
		while (n > m) n = n - m; //3
	}
	printf("m=%d\n", m);
	return 0;
}